home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
wb
/
czesc_2
/
fakedeficon
/
fakedeficon.readme
< prev
Wrap
Text File
|
1994-06-07
|
9KB
|
192 lines
*-*-*-*-*-*-*-*-*-*-*-*-*
| Fake WB Default Icons |
*-*-*-*-*-*-*-*-*-*-*-*-*
Version 0.1
The contents of this archive are Copyright (c) 1994, Jason R. Hulance. The
archive may be freely distributed so long as it remains complete and is not
altered.
Introduction
*-*-*-*-*-*-*-*
The "FakeDefIcon" program provides full and flexible file type recognition
and automatic tool usage for files which have no icons. It does this by
patching several system routines and fooling Workbench.
Fake, 'pseudo' icons are used by Workbench (Release 2 and greater) for files
which have no icons, when the 'Show All Files' option is used. The
"FakeDefIcon" program redirects Workbench to use different icons according
to the type of the icon-less file. For example, it can recognise an IFF
ILBM and will fake a nice(?) picture icon for it, rather than the normal
Workbench pseudo project or tool icon. However, these icons are still
pseudo icons, so the supplied icon's default tool is not run when the icon
is double-clicked, rather the 'Execute a File' requester appears as normal.
All is not lost, though, as "FakeDefIcon" intercepts the 'Execute a File'
requester and fills in the command line with the appropriate tool and
arguments.
This may seem a little strange, making the process two stage (i.e., three
mouse clicks), but it has the benefit of letting the user change their mind
about which tool to run. For example, a GIF picture might be set up to run
"Multiview" with a 'SCREEN' argument by default. It is then a simple matter
of a single keystroke (in the 'Execute a File' requester) to eliminate the
'SCREEN' argument if the user changes their mind and wants the picture on,
say, the Workbench screen.
You can also use "FakeDefIcon" without faking icons! In this case you get
the normal pseudo icons, but the 'Execute a File' requester is still filled
in properly for you.
Requirements
*-*-*-*-*-*-*-*
"FakeDefIcon" works under v37 and v39 of Workbench (that's Release 2 and 3,
to some people). I'm not sure about newer versions, although I guess
Workbench won't change too much... Maybe one day it will have file typing as
standard. (It definitely won't work under Release 1.3, by the way!)
The "whatis.library" is required. If you don't already have it then it
should be available from the same place you found this! I left it out of
this archive in order to keep the size down, and because a lot of people
already have it. (The "whatis.library" is Copyright S.R. & P.C.)
To run this program from the 'Startup-Sequence' you will need a "RUNBACK"
program.
Installation
*-*-*-*-*-*-*-*
1) Copy the executable "FakeDefIcon" somewhere, preferably on your path
(e.g., the C: directory).
2) Make sure you have the "whatis.library" in your LIBS: (else download it
from somewhere). You might like to take a look at the 'FileTypes' file
in the S directory of this archive, since it supplies ICONNAMEs for some
of the existing types that don't already have them. If you want to use
this file then copy it to your S: directory.
3) Copy the icons in the Icons directory to 'ENVARC:sys', by doing something
like this:
COPY Icons/#? ENVARC:sys
4) Now, either reboot or copy the icons to 'ENV:sys', too. Either way you
will end up with the icons in 'ENV:sys' where they need to be.
You can now run the program. Be careful because it patches system routines
and does *NOT* check that they can be safely unpatched if you want to stop
the program. If you run "FakeDefIcon" from the Shell/CLI then you can press
Ctrl-C to unload/stop it. Otherwise you need to use the BREAK command.
If you like the program then you might like to run it from the
'Startup-Sequence'. It is best to do this by putting the following command
in the 'User-Startup' file in your S: directory
RUNBACK >NIL: FakeDefIcon
You can unload it by using the "STATUS" command to find the process and then
using "BREAK" in the normal way.
Options
*-*-*-*-*
The "FakeDefIcon" program has the following options: NOFAKE/S,DEBUG/N.
The 'NOFAKE' option turns off the faking of pseudo icons, but the 'Execute a
File' editing remains. The 'DEBUG' option needs a number to be specified:
zero means no debugging (the default), one means that "FakeDefIcon" will
tell you about the files it can't find a type for, two means that it will
tell you about the types it can't find icons for, and three means it will
tell you about both. The debugging option may be useful when you're setting
up your own S:FileTypes file for the "whatis.library".
Because "FakeDefIcon" is written in Amiga E it can also be run from the
Workbench.
Default Tools and Tool Types
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
The icons in ENV:sys can have default tools and tool types to specify the
tool used by the "FakeDefIcon" program. For example, the icon for plain
text files ('def_text.info') may have the default tool "More". In this case
'FakeDefIcon' will fill in the 'Execute a File' requester by prefixing the
file name with "More". Clicking on the OK gadget will then run "More" on
the text file.
As well as the default tool you can specify arguments to be passed to the
tool using the 'PRE_ARGS' and 'POST_ARGS' tooltypes. For example, the icon
for a GIF file ('def_GIF.info') may have the default tool "Multiview" and a
'PRE_ARGS=SCREEN' tooltype. In this case the argument 'SCREEN' will precede
the file name in the 'Execute a File' requester. (Pressing Ctrl-W will
erase the word 'SCREEN' in the requester, if you want the picture to appear
on the Workbench screen.)
Another example is the icon for Lharc (or LHA) archives. This may have the
default tool "lha", a 'PRE_ARGS=-m e' tooltype and a 'POST_ARGS=Ram:'
tooltype. "FakeDefIcon" will then create, in the 'Execute a File'
requester, the command line:
lha -m e fred.lha ram:
for a file 'fred.lha' (with no real icon).
The icons in the archive have default tools and tooltypes set up how I have
them, but you are free to change them how you like. And don't think you're
stuck with the supplied icon images -- use your faves from MagicWB etc. if
you want.
Out-troduction
*-*-*-*-*-*-*-*-*
This is a first, test release. If other people find them useful then I'll
try to support them and maybe make "FakeDefIcon" a lot faster (it's very
slow at the moment, mainly due to the list it needs to access in a sorted
way). The installation etc. could also do with some tidying up, but it's
not worth it if no-one uses this!
I wrote these programs because Icon 1.0 by Olaf 'Olsen' Barthel of MXM (way
back in 1990!, and on an old Fish Disk), and all other similar programs
(most recently IconManager by Alex Taylor), don't work properly. The
problem is that Workbench does not work in the most convenient way. In
particular, the way these programs know that Workbench is going to want
default icons is by looking at the menu strip and seeing if 'Show All Files'
is checked. This would be fine if Workbench checked this flag before it
started looking, but unfortunately it does it after it's finished looking.
This is why you need to do frequent 'Updates' to get these programs to
display their fake icons properly (for instance, if you go from a drawer
with 'Show Only Icons' to a drawer inside this that has 'Show All Files').
My 'FakeDefIcon' program *ALWAYS* supplies fake icons properly, since it
catches the Workbench calls to open 'def_project' and the like. The only
pain in the neck is that Workbench sorts its list of icon-less files...
If you find that "FakeDefIcon" is too slow (e.g., you're a floppy user with
directories with loads of files) then you might like to just use the
'NOFAKE' option, and be surprised(?) when it shows you the file is really a
JPEG picture when the 'Execute a File' requester pops up.
Blatant Plug
*-*-*-*-*-*-*-*
The source to this program is *not* a good example of Amiga E!!! It is
horribly hacked and try to reuse variables too much (cautious about the
Workbench stack that they run on). But don't let this put you off
investigating Amiga E, the super-fast language designed and implemented by
Wouter van Oortmerssen. The current version is 2.1b, it's Public Domain and
it's very well supported (try the Amiga E mailing list, mail a SUBSCRIBE or
HELP request to "amigae-request@bkhouse.cts.com"). A new version (3.0) is
on the way, soon, and is going to be amazing from all current indications.
Contact
*-*-*-*-*
E-mail with your complaints, suggestions etc. at:
jason@fsel.com
or
m88jrh@ecs.ox.ac.uk